package org.focusj.scala.apps

/**
 * 伴生对象
 */
class Counter {
    val id = Counter.newUniqueNum
}

object Counter { // 伴生对象
    private var lastNum = 0
    private def newUniqueNum() = { lastNum += 1; lastNum }
}

